function [y] = logistic_predict(weights, data)
% Compute the probabilities predicted by the logistic classifier.
%
% Note: N is the number of examples and
%       M is the number of features per example.
%
% Inputs:
%   weights:    (M+1) x 1 vector of weights, where the last element
%               corresponds to the bias (intercepts).
%   data:       N x M data matrix where each row corresponds
%               to one data point.
% Outputs:
%   y:          N x 1 vector of probabilities.
%               This is the output of the classifier.
%
% Yuanbo Han, 2017-11-12.

[N, ~] = size(data);
z = [data, ones(N,1)] * weights;
y = sigmoid(z);
end
